<template>
{{#if page.psSysPFPlugin}}
    {{> @macro/plugins/view/view-use.hbs appPlugin=page.psSysPFPlugin}}
{{else}}
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
    <AppBasisViewLayout :class="classNames" :openType="openType">
        <template #viewHeaderContentLeft v-if="model.showCaption && !noViewCaption">
            <div class="view-header__caption">
                {{> @macro/view/view-caption.hbs}}
            </div>
        </template>
        {{#each page.ctrls as | ctrl |}}
        {{#eq controlType 'PANEL'}}
        <template #default>
            {{> @macro/widgets/panel-detail/panel.hbs ctrl=ctrl props=":isLoadDefault='true'
            :viewType='model.viewType'"}}    
        </template>
        {{/eq}}
        {{/each}}
        {{> @macro/view/view-msg.hbs}}  
    </AppBasisViewLayout>
    {{else}}
    <div :class="classNames">
        {{#if page.psViewLayoutPanel.rootPSPanelItems}}
        {{#each page.psViewLayoutPanel.rootPSPanelItems as | panelItem |}}
        {{> @macro/widgets/panel-detail/include-panel.hbs type=panelItem.itemType item=panelItem isMultiData=false panel=page.psViewLayoutPanel page=page}}
        {{/each}}
        {{/if}}
    </div>
    {{/if}}
{{/if}}
</template>
<script setup lang="ts">
// 基于template/src/views/\{{appModules}}/\{{pages@DEPANELVIEW}}/\{{spinalCase page.codeName}}.vue.hbs生成
{{#if page.psViewLayoutPanel.useDefaultLayout}}
import { AppBasisViewLayout } from "@components/layout/basis-view-layout";
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{else}}
import { AppCtrlPos, AppScrollContainer, AppSimpleFlexContainer, AppStandardContainer, AppTabPanel, AppTabPage } from '@components/layout-element/structure';
{{#if page.psViewLayoutPanel.viewProxyMode}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.psViewLayoutPanel.psControls}}
{{else}}
{{> @macro/widgets/ctrl/import-ctrl.hbs ctrls=page.ctrls}}
{{/if}}
{{/if}}
import { model } from "./{{spinalCase page.codeName}}-model";
import { 
    useNavParamsBind,
    useEventBind, 
    handleCtrlAction, 
    handleCtrlInit, 
    handleCtrlDestroy, 
    getViewClassNames,
{{#unless page.psViewLayoutPanel.useDefaultLayout}}
    handleComponentAction,
    {{#if page.psViewLayoutPanel.psControls}}
    {{#each page.psViewLayoutPanel.psControls as | ctrl |}}
    {{#eq ctrl.controlType 'TOOLBAR'}}
    handleToolbarItemClick,
    {{/eq}}
    {{/each}}
    {{/if}}
{{/unless}}
} from "@/hooks/use-view";
import { IContext, IParam, IPanelViewAbility, ILoadingHelper, PanelViewController, IPanelViewController, IPanelViewControllerParams, PanelViewActionType, IPanelViewStore, IEvent } from "@/core";

{{> @macro/view/view-props.hbs}}

{{> @macro/common/emit.hbs name="view" actionType="PanelViewActionType" ability="IPanelViewAbility"}}    

//  样式名称
const classNames = computed(() => {
  return getViewClassNames(model, props);
});

const params: IPanelViewControllerParams<PanelViewActionType, IPanelViewAbility> = { 
    name: props.name,
    model, 
    evt, 
    openType:props.openType, 
    pLoadingHelper: props.pLoadingHelper, 
    isLoadDefault: props.isLoadDefault,    
    handler: (data: IPanelViewStore) => { return reactive(data); }
}

{{> @macro/common/controller.hbs name="view" IController="IPanelViewController" store="IPanelViewStore" ability="IPanelViewAbility" controller="PanelViewController"}}
</script>
